/*****************************************************************************************
Arise Engine		RenderView.h

					E-mail:		arise_engine@mail.ru

created:			17.03.2007
last changes:		13.02.2008

RenderView.h : interface of the RenderView class

Project is an MFC application, using the single-document model, split-window style.
Based on EffectEdit Direct3D Sample (c) Microsoft Corporation. All rights reserved.
*****************************************************************************************/
#pragma once

#include "..\dx_util\d3dapp.h"
#include "..\input\Input.h" 


class RenderView : public CFormView, public CD3DApplication
{
protected: // create from serialization only
	
	RenderView();
	DECLARE_DYNCREATE(RenderView)
    
    HWND	m_hwndRenderWindow;

private:

	int		m_size_x;
	int		m_size_y;
	bool	m_is_fullscreen;
	    
    void SwitchSceneProcessingType();

public:
// Attributes
	CAriseEditorDoc* GetDocument();

// Operations
	//{{AFX_DATA(CErrorsView)
    enum { IDD = IDD_RENDER_FORMVIEW };
    //}}AFX_DATA
	

// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CRenderView)
    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    virtual void OnInitialUpdate(); // called first time after construct
    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
    //}}AFX_VIRTUAL

public:
   
	virtual HRESULT AdjustWindowForChange();
    virtual HRESULT FrameMove();
    virtual HRESULT Render();
    virtual HRESULT OneTimeSceneInit();
	virtual HRESULT RestoreDeviceObjects();
	virtual HRESULT InitDeviceObjects();
	virtual HRESULT DeleteDeviceObjects();
	virtual HRESULT InvalidateDeviceObjects();
	HRESULT			FinalCleanup();

// Implementation
	virtual ~RenderView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif


protected:
	// Generated message map functions
    //{{AFX_MSG(CRenderView)
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnRender();
public:
 	afx_msg void OnToggleFullscreen();
   //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in RenderView.cpp
inline CAriseEditorDoc* RenderView::GetDocument()
   { return reinterpret_cast<CAriseEditorDoc*>(m_pDocument); }
#endif

extern HWND g_hwndRenderFullScreen;
